\documentclass[12pt]{report}
\usepackage{a4wide}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{longtable}

\title{SOFTWARE ARCHITECTURE}
\author{Roel Coomans (r0235631) \& Sam Segers (r0262894)}

\setlength{\parindent}{0cm}

\begin{document}

\maketitle
\pagestyle{myheadings}
\markright{Phase II - Architecture Design}

\chapter{Use Cases} \label{useCases}
\section*{Requirement number 1: Landlord/janitor in apartment buildings}
\subsection*{UC10: Detect anomaly}
Use case 10 can be applied to the landlord/janitor. In this case the landlord/janitor is the customer and the alarm recipient.

\subsection*{UC11: Operate actuator remotely}
Use case 11 can also be applied to the landlord/janitor. A possible difference is that the janitor might have more than one actuators he can operate remotely.

\subsection*{UC18: request module/valve overview}
\begin{itemize}
\item Description: The primary actor needs an overview of all the modules/meters that are related to him.
\item Primary actor: Normal Customer, Landlord/janitor
\item Interested parties:
\begin{itemize}
\item Landlord: wants an overview of all the modules under his supervision.
\item Customer: wants a fine-grained overview all meters of his module(primary and secondary).
\end{itemize}
\item Preconditions: 
\begin{itemize}
\item The primary actor must have a contract
\item The primary actor must be logged in
\end{itemize}
\item Post condition: The primary actor gets an overview of all related modules/meters.
\item Main scenario
\begin{enumerate}
\item The primary actor indicates that he wants to see an overview of all modules/meters that are related to him.
\item ReMeS looks up which modules/meters are related to the primary actor.
\begin{itemize}
\item If the primary actor is a Landlord, this are all the modules that are under his supervision.
\item If the primary actor is a Customer, this at least is the primary meter, possibly complemented with all the secondary meters.
\end{itemize}
\item ReMeS shows an overview including all retrieved modules. This includes for each module at least:
\begin{itemize}
\item The state, whether it's active or not.
\item When a module isn't closed yet, and a valve actuator is present, the possibility to close immediately.
\item An indication when abnormal behavior is detected, so the landlord can easily see this, and react quickly. 
\item The latest consumption history.
\end{itemize}
\item Alternative scenario:
\begin{itemize}
\item 3a. If the primary actor has no related module (i.e. no device linked), nothing is shown and ReMeS notifies him.
\end{itemize}
\end{enumerate}
\end{itemize}

\section*{Requirement 2: Implement Modifiable scenario M2}
\subsection*{M2: Fine-grained metering for enterprises}
In our opinion there is no big difference between requirement 1 and requirement 2. The landlord can have multiple modules under his control, which is in fact not much difference with the fine-grained option in M2. Because the fine-grained option gives the customer the probability to have more modules and hence more detailed measurements. A possible difference lies perhaps in the fact that the landlord has control over multiple primary modules and with the fine grained solution there is only one primary module that is complemented with a number of secondary modules. The main functionality of M2 is described in UC18. We made the primary actor abstract so it would also fit the functionality of this requirement.

\section*{Requirement number 3: Third-party fraud detection}

\subsection*{UC19: Send batch data to 3rd party for fraud detection}
\begin{itemize}
\item Description: ReMeS sends a batch of measurement data to the 3rd party fraud detection system.
\item Trigger: For every specified period of time this is done (e.g. every day)
\item Preconditions: Measurement data must be available.
\item Primary actor: ReMeS, the fraud dectection system.
\item Interested parties: 
\begin{itemize}
\item Utility Provider: wants to know when there is fraud detected, because his utility is being used in the fraud.
\end{itemize}
\item Post condition: The ReMeS system gets the fraud detection result of the 3rd party fraud detection company.
\item Main scenario
\begin{enumerate}
\item ReMeS gathers the required measurement data.
\item ReMeS sends the data to the 3rd party fraud detection system.
\item ReMeS receives that the data is send well.
\item ReMeS gets the result of the fraud detection system.
\end{enumerate}
\item Alternative scenario:
\begin{itemize}
\item 3a. If ReMeS does not receive any response from the 3rd party fraud detection system, after a time interval (e.g. \textit{using exponential backoff})return to step 2.
\item 3b. If ReMeS receives an error from the detection system, immediately return to step 2.
\end{itemize}
\end{itemize}

\chapter{ADD} \label{ADD}
\input{run1.tex}
\input{run2.tex}
\input{run3.tex}
\input{run4.tex}
\input{run5.tex}

\input{finalArchitecture}
\input{scenarios}

\part*{Appendix}
\input{elementCatalog.tex}
\input{interfaces.tex}

\end{document}